public li: HTMLElement) { var childLIs: HTMLLIElement[] = [];
for (var i = 0; i < this.li.children.length; i++) { var child = this.li.children[i];
if ((<HTMLLIElement>child).tagName === 'LI') childLIs.push(<HTMLLIElement>child);
if ((<HTMLDivElement>child).tagName === 'DIV' && (<HTMLDivElement>child).className) { if ((<HTMLDivElement>child).className.indexOf('teapo-file-name') >= 0) { this.name = child.textContent || (<HTMLDivElement>child).innerText;
else if ((<HTMLDivElement>child).className.indexOf('teapo-dir-name') >= 0) { this.name = child.textContent || (<HTMLDivElement>child).innerText;
if ((<HTMLPreElement>child).tagName === 'PRE' && (<HTMLPreElement>child).className
&& (<HTMLPreElement>child).className.indexOf('teapo-file-content') >= 0) { this._contentPRE = <HTMLPreElement>child;
this.fullPath = parentPath + '/' + this.name;
this._createChildNodesAndSort(childLIs);
private _createChildNodesAndSort(childLIs: HTMLLIElement[]) { for (var i = 0; i < childLIs.length; i++) { var node = new Node(this.fullPath, childLIs[i]);
this._insertChildNode(this._subDirs, node, <any>this._files.length);
this._insertChildNode(this._subDirs, node, false);
private _insertChildNode(nodeList: Node[], nodeNode, forceRerootingEvenIfOrdered: boolean) {